<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<p id="demo"></p>
<script>
    function x() {
        var i,sum=0;
        for (i = 0; i < arguments.length; i++) {
            sum += arguments[i];
        }
        return sum;
    }

    console.log(x(1,2,3,4,5))

    arr=[1,3,55,7,9,-11,-4]
    var x;
    x=Math.min.apply(x,arr)
    document.getElementById("demo").innerHTML=x

    function mymax() {
        var i, max = arguments[0];
        for (i = 0; i < arguments.length; i++) {
            if (arguments[i] > max) {
                max = arguments[i];
            }
        }
        return max;
    }

    var y = mymax.apply(y, arr);
    document.getElementById("demo").innerHTML=y;
</script>
</body>
</html>